package tetris;

/**
 * File: ErsBox.java
 * User: ���ة
 * Date: 2004.12.3
 * Describe: ����˹����� Java ʵ��
 */
import java.awt.Dimension;

/**
 * �����࣬����ɿ�Ļ�Ԫ�أ����Լ�����ɫ����ʾ������
 */
class TetrisCell implements Cloneable {
	private boolean isColor;
	private Dimension size = new Dimension();

	/**
	 * ������Ĺ��캯��
	 * 
	 * @param isColor
	 *            �ǲ�����ǰ��ɫ��Ϊ�˷�����ɫ�� trueǰ��ɫ��false�ñ���ɫ
	 */
	public TetrisCell(boolean isColor) {
		this.isColor = isColor;
	}

	/**
	 * �˷����ǲ�����ǰ��ɫ����
	 * 
	 * @return boolean,true��ǰ��ɫ���֣�false�ñ���ɫ����
	 */
	public boolean isColorBox() {
		return isColor;
	}

	/**
	 * ���÷������ɫ��
	 * 
	 * @param isColor
	 *            boolean,true��ǰ��ɫ���֣�false�ñ���ɫ����
	 */
	public void setColor(boolean isColor) {
		this.isColor = isColor;
	}

	/**
	 * �õ��˷���ĳߴ�
	 * 
	 * @return Dimension,����ĳߴ�
	 */
	public Dimension getSize() {
		return size;
	}

	/**
	 * ���÷���ĳߴ�
	 * 
	 * @param size
	 *            Dimension,����ĳߴ�
	 */
	public void setSize(Dimension size) {
		this.size = size;
	}

	/**
	 * ����Object��Object clone()��ʵ�ֿ�¡
	 * 
	 * @return Object,��¡�Ľ��
	 */
	public Object clone() {
		Object cloned = null;
		try {
			cloned = super.clone();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return cloned;
	}
}
